<%@ page import="hotsaucerecipes.Review" %>
<!doctype html>
<html>
<head>
    <meta name="layout" content="main">
    <g:set var="entityName" value="${message(code: 'review.label', default: 'Review')}"/>
    <title><g:message code="default.show.label" args="[entityName]"/></title>
</head>

<body>
<a href="#show-review" class="skip" tabindex="-1"><g:message code="default.link.skip.label"
                                                             default="Skip to content&hellip;"/></a>

<div class="nav" role="navigation">
    <ul>
        <li><g:link class="list" action="list"><g:message code="default.list.label"
                                                          args="[entityName]"/></g:link></li><g:if
            test="${session?.user}">
        <li><g:link class="create" action="create"><g:message code="default.new.label"
                                                              args="[entityName]"/></g:link></li></g:if>
    </ul>
</div>

<div id="show-review" class="content scaffold-show" role="main">
    <h1><g:message code="default.show.label" args="[entityName]"/></h1>
    <g:if test="${flash.message}">
        <div class="message" role="status">${flash.message}</div>
    </g:if>
    <ol class="property-list review">

        <g:if test="${reviewInstance?.title}">
            <li class="fieldcontain">
                <span id="title-label" class="property-label"><g:message code="review.title.label"
                                                                         default="Title"/></span>

                <span class="property-value" aria-labelledby="title-label"><g:fieldValue bean="${reviewInstance}"
                                                                                         field="title"/></span>

            </li>
        </g:if>

        <g:if test="${reviewInstance?.rating}">
            <li class="fieldcontain">
                <span id="rating-label" class="property-label"><g:message code="review.rating.label"
                                                                          default="Rating"/></span>

                <span class="property-value" aria-labelledby="rating-label"><g:fieldValue bean="${reviewInstance}"
                                                                                          field="rating"/></span>

            </li>
        </g:if>

        <g:if test="${reviewInstance?.comments}">
            <li class="fieldcontain">
                <span id="comments-label" class="property-label"><g:message code="review.comments.label"
                                                                            default="Comments"/></span>

                <span class="property-value" aria-labelledby="comments-label"><g:fieldValue bean="${reviewInstance}"
                                                                                            field="comments"/></span>

            </li>
        </g:if>


        <g:if test="${reviewInstance?.recipe}">
            <li class="fieldcontain">
                <span id="recipe-label" class="property-label"><g:message code="review.recipe.label"
                                                                          default="Recipe"/></span>

                <span class="property-value" aria-labelledby="recipe-label"><g:link controller="recipe"
                                                                                    action="show"
                                                                                    id="${reviewInstance?.recipe?.id}">${reviewInstance?.recipe?.encodeAsHTML()}</g:link></span>

            </li>
        </g:if>

    </ol>
    <g:if test="${session?.user}">
        <g:form>
            <fieldset class="buttons">
                <g:hiddenField name="id" value="${reviewInstance?.id}"/>
                <g:link class="edit" action="edit" id="${reviewInstance?.id}"><g:message
                        code="default.button.edit.label"
                        default="Edit"/></g:link>
                <g:actionSubmit class="delete" action="delete"
                                value="${message(code: 'default.button.delete.label', default: 'Delete')}"
                                onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');"/>
            </fieldset>
        </g:form>
    </g:if>
</div>
</body>
</html>
